package com.mplus;


import org.greenrobot.greendao.generator.DaoGenerator;
import org.greenrobot.greendao.generator.Entity;
import org.greenrobot.greendao.generator.Schema;

/**
 * Created by Administrator on 2016/9/1.
 */
public class MPlusGenerator {
    public static void main(String[] args) throws Exception{
        Schema schema=new Schema(1,"com.yuanduan.mplus.db.entity");
        schema.setDefaultJavaPackageDao("com.yuanduan.mplus.db.dao");
        schema.enableKeepSectionsByDefault();
        addUser(schema);
        new DaoGenerator().generateAll(schema,"./app/src/main/java");
    }

    private static void addUser(Schema schema) {
        Entity user=schema.addEntity("User");
        user.addLongProperty("_id").primaryKey().autoincrement();
        user.addIntProperty("id");
        user.addStringProperty("UserPhone");
        user.addStringProperty("UserPwd");
        user.addStringProperty("RealName");
        user.addStringProperty("UserHead");
        user.addStringProperty("UserType");
        user.addStringProperty("CarTeamID");
        user.addStringProperty("LookCarID");
        user.addStringProperty("IDCard");
        user.addStringProperty("Age");
        user.addStringProperty("AttributionID");
        user.addStringProperty("Professional");
        user.addStringProperty("CreateTimer");
        user.addStringProperty("CarNumber");
        user.addStringProperty("CarTeamName");
        user.addIntProperty("Sex");
        user.addIntProperty("Audit");
        user.addStringProperty("Reason");
    }
}
